package com.itheima.demo03;

public class Student {
    //属性, 全部私有.
    private String name;    //姓名
    private int age;        //年龄

    //构造方法, 空参, 全参.
    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    //getXxx()和setXxx()
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    //成员方法
    //学习
    public void study() {
        System.out.println("键盘敲烂, 月薪过万!");
    }

    //吃饭
    public void eat() {
        System.out.println("学习饿了要吃饭");
    }
}
